import {fork} from 'child_process'

function createWorker () {
  let worker = fork('./node/demo/worker')
  console.log(`create worker: ${worker.pid}`)
  worker.on("exit", () => {
    console.log(worker.pid, "exit")
    createWorker()
  })
}


createWorker()